package com.pxx.pj.pxx.controller;

import com.pxx.pj.common.pojo.JsonResult;
import com.pxx.pj.common.pojo.PageObject;
import com.pxx.pj.pxx.pojo.PxxLog;
import com.pxx.pj.pxx.service.PxxLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
public class PxxLogController {

    @Autowired
    private PxxLogService pxxLogService;

    @DeleteMapping("/log/doDeleteObjects/{ids}")//rest
    public JsonResult doDeleteObjects(@PathVariable Integer... ids){
        pxxLogService.deleteObjects(ids);
        return new JsonResult("delete ok");
    }


    @GetMapping("/log/doFindPageObjects")
    public JsonResult doFindPageObjects(String username, Integer pageCurrent){
        PageObject<PxxLog> pageObject= pxxLogService.findPageObjects(username, pageCurrent);
        return new JsonResult(pageObject);//封装的是正确的响应结果
    }
}
